<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>数组</title>
    <script type="text/javascript">
        /**
         * Java中创建数组的方式：
         * int[] arr1 = new int[3];
         * int[] arr2 = new int[]{1,2,3};
         * int[] arr3 = {1,2,3};
         * JavaScript中创建数组的方式：
         * var arr1 = new Array(5);
         * var arr2 = [1,2,3];
         */
        var arr = [100,"你好",true,new Date()];
        arr[7] = "hello";
        //alert(arr.length);
        for (var i = 0; i < arr.length; i++) {
            alert(arr[i]);
        }
    </script>
</head>
<body>

</body>
</html>